<template>
  <div>
      <p>登陆页</p>
    <h1>会员余额：{{$store.state.money}}</h1>
      <input type="text" v-model="name">
      <button @click="login">login</button>
  </div>
</template>

<script>
export default {
    data() {
        return {
            name: ''
        }
    },
    // 组件内的守卫
    beforeRouteEnter(to, from, next) {
        console.log(1111, to);
        console.log(2222, from);
        next()
    },
    methods: {
        login() {
            localStorage.setItem('name', this.name)
        }
    }
}
</script>

<style>

</style>